@extends('backend::layout')
@section('title',trans($page_title))
@section('content')
    @component('backend::component.table.table-content')
        @slot('page_title') {{$page_title}} @endslot
        @slot('tools_btn')
            @component('backend::component.form.button')
                @slot('title') 添加轮播图 @endslot
                @slot('elem') a @endslot
                @slot('color') info @endslot
                @slot('icon') hcl-img-upload @endslot
                @slot('href') {{route('b_ShopAd_createSlide')}} @endslot
            @endcomponent
            @component('backend::component.form.button')
                @slot('title') 批量删除 @endslot
                @slot('btn') btn @endslot
                @slot('color') danger @endslot
                @slot('icon') hcl-remove @endslot
                @slot('class') btn-ajax @endslot
                @slot('params')
                    {"url":"{{route('b_ShopAd_deleteSlide')}}","method":"post","title":"删除轮播图","targetData":".id","confirm":"true"}
                @endslot
            @endcomponent
        @endslot
        @slot('body_content')
            @if($list->isNotEmpty())
                <table class="list table table-bordered table-striped">
                    <thead>
                    <tr>
                        <th>
                            @component('backend::component.checkbox')
                                @slot('name') ids-all @endslot
                            @endcomponent
                        </th>
                        <th>图片</th><th>访问链接</th><th>位置</th><th>状态</th><th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach($list as $value)
                        <tr>
                            <td>
                                @component('backend::component.checkbox')
                                    @slot('name') slide_ids[] @endslot
                                    @slot('class') id @endslot
                                    @slot('value') {{$value->id}} @endslot
                                @endcomponent
                            </td>
                            <td>
                                <img src="{{$value->img_url}}" style="height: 40px;" />
                                </td>
                            <td>{{$value->title}}</td>
                            <td>{{config('shop.ad_slide_type')[$value->type]}}

                            </td>
                            <td>
                                @component("backend::component.switch")
                                    @slot('params'){"url":"{{route('b_ShopBrand_state',['id'=>$value->id])}}"} @endslot
                                    @slot('checked') @if($value->status == 1) checked @endif @endslot
                                @endcomponent
                            </td>
                            <td>
                                @component('backend::component.form.button')
                                    @slot('title') 删除 @endslot
                                    @slot('icon') hcl-remove @endslot
                                    @slot('color') danger @endslot
                                    @slot('params') {"url":"{{route('b_ShopAd_deleteSlide',['slide_ids'=>$value->id])}}","confirm":"true"} @endslot
                                    @slot('class') btn-ajax @endslot
                                @endcomponent
                                @component('backend::component.form.button')
                                    @slot('title') 编辑 @endslot
                                    @slot('elem') a @endslot
                                    @slot('href') {{route('b_ShopAd_updateSlide',['ad_id'=>$value->id])}} @endslot
                                    @slot('icon') hcl-edit1 @endslot
                                    @slot('color') primary @endslot
                                @endcomponent
                            </td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
            @else
                @component('backend::public.empty_page')
                    @slot('info') 暂时没有轮播图 @endslot
                @endcomponent
            @endif
        @endslot
    @endcomponent
@endsection